import request from "@/utils/http/request";
import { mockApi } from "@/utils/util";

// stat 点击量
export function countPv(data: any) {
  // return mockApi(data);

  return request({
    url: `appChannel/saveClick`,
    method: "POST",
    data: data,
  });
}

// 刷新验证码

export function refreshCodeImg() {
  // return mockApi(data);
  return request({
    url: `appChannel/kaptcha`,
    method: "GET",
    responseType: "arraybuffer",
    // data: data,
  });
}

// 下载 (点击下一步)
export function downloadApk(data: any) {
  // return mockApi(data);
  return request({
    url: `appChannel/saveRegister`,
    method: "POST",
    data: data,
  });
}

//

// 发送验证码
export function sendCode(obj) {
  return request({
    url: `login/sendCode`,
    method: "POST",
    params: obj,
  });
}

// 登录
export function submit(obj: {
  channelCode: String;
  phone: Number;
  code: Number;
  grantType: String;
}) {
  return request({
    url: `login/submit`,
    method: "post",
    params: obj,
  });
}
